﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ElasticSearch.BLL.Model
{

    public class Elastic
    {
        /// <summary>
        /// 耗时(毫秒)
        /// </summary>
        public int Took { get; set; }

        /// <summary>
        /// 是否超时
        /// </summary>
        public bool TimeOut { get; set; }

        /// <summary>
        /// 分片信息
        /// </summary>
        public Shards Shards { get; set; }


    }
    public class Elastic<T>: Elastic
    {
        /// <summary>
        /// 查询结果
        /// </summary>
        public Hits<T> Hits { get; set; }
    }

    /// <summary>
    /// 查询 分片信息
    /// </summary>
    public class Shards
    {
        /// <summary>
        /// 分片总数
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 查询成功分片数
        /// </summary>
        public int Successful { get; set; }

        /// <summary>
        /// 查询跳过分片数
        /// </summary>
        //public int Skipped { get; set; }

        /// <summary>
        /// 查询失败分片数
        /// </summary>
        public int Failed { get; set; }
    }


    public class Hit
    {
        /// <summary>
        /// 查询结果的数量
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 最大匹配分值
        /// </summary>
        public double? MaxScore { get; set; }
    }

    /// <summary>
    /// 查询命中信息
    /// </summary>
    public class Hits<T>:Hit
    {
        public List<T> Data { get; set; }
    }
}
